package com.xncoding.minispring.Listener;

import com.xncoding.minispring.Event.BaseEvent;
import com.xncoding.minispring.Event.EntityCreatedEvent;
import com.xncoding.minispring.Event.PersonEvent;
import com.xncoding.minispring.Event.PluginEvent;
import com.xncoding.minispring.modle.Order;
import com.xncoding.minispring.modle.Person;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class PluginEventListener {
    @EventListener
    public void handlePluginEvent(PluginEvent event) {
        // 处理插件事件逻辑
        System.out.println("PluginEvent事件发布");
    }
    @EventListener
    public void handlePersonEvent(PersonEvent personEvent) {
        System.out.println("监听到PersonEvent: {}"+personEvent);
    }

    @EventListener
    public void handlePersonEvent(BaseEvent<Person> personEvent) {
        System.out.println("监听到PersonEvent:t" + personEvent);
    }

    @EventListener
    public void handle0rderEvent(BaseEvent<Order> orderEvent) {
        System.out.println("ll@lorderEvent: (J" + orderEvent);
    }

    @EventListener
    public void onPersonCreated(EntityCreatedEvent< Person > event) {
        System.out.println("ll@EntityCreatedEvent: (J" + event);
    }

}